home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Developers / src / out-of-phase-102-c / OutOfPhase 1.02 Source / OutOfPhase Folder / WaveTableWindow.h < prev   
Encoding:
C/C++ Source or Header  |  1994-11-23  |  6.1 KB  |  171 lines  |  [TEXT/KAHL]

  1. /* WaveTableWindow.h */
  2.  
  3. #ifndef Included_WaveTableWindow_h
  4. #define Included_WaveTableWindow_h
  5.  
  6. /* WaveTableWindow module depends on */
  7. /* MiscInfo.h */
  8. /* Audit */
  9. /* Debug */
  10. /* Definitions */
  11. /* MainWindowStuff */
  12. /* CodeCenter */
  13. /* WaveTableList */
  14. /* Screen */
  15. /* Menus */
  16. /* EventLoop */
  17. /* TextEdit */
  18. /* IconButton */
  19. /* Scroll */
  20. /* SimpleButton */
  21. /* SampleView */
  22. /* WindowDispatcher */
  23. /* WaveTableObject */
  24. /* Memory */
  25. /* Numbers */
  26. /* SampleConsts */
  27. /* Array */
  28. /* DataMunging */
  29. /* EditImages */
  30. /* GrowIcon */
  31. /* Main */
  32. /* StringDialog */
  33. /* FindDialog */
  34. /* GlobalWindowMenuList */
  35. /* WaveTableStorage */
  36. /* WaveTableStorageDisplay */
  37. /* SoundOutput */
  38. /* Alert */
  39. /* NumberDialog */
  40. /* WaveTableSizeDialog */
  41. /* CompilerRoot */
  42. /* PcodeObject */
  43. /* PcodeStack */
  44. /* PcodeSystem */
  45. /* FunctionCode */
  46. /* FixedPoint */
  47.  
  48. #include "Screen.h"
  49. #include "Menus.h"
  50. #include "EventLoop.h"
  51. #include "SampleConsts.h"
  52. #include "FixedPoint.h"
  53.  
  54. struct WaveTableWindowRec;
  55. typedef struct WaveTableWindowRec WaveTableWindowRec;
  56.  
  57. /* forward declarations */
  58. struct MainWindowRec;
  59. struct WaveTableObjectRec;
  60. struct CodeCenterRec;
  61. struct WaveTableListRec;
  62. struct WaveTableStorageRec;
  63.  
  64. /* create a new wave table window. */
  65. WaveTableWindowRec*    NewWaveTableWindow(struct MainWindowRec* MainWindow,
  66.                                             struct WaveTableObjectRec* WaveTableObject,
  67.                                             struct CodeCenterRec* CodeCenter,
  68.                                             struct WaveTableListRec* WaveTableList,
  69.                                             struct WaveTableStorageRec* WaveData,
  70.                                             OrdType WinX, OrdType WinY, OrdType WinWidth, OrdType WinHeight);
  71.  
  72. /* write back modified data and dispose of the wave table window */
  73. void                                DisposeWaveTableWindow(WaveTableWindowRec* Window);
  74.  
  75. /* return True if the data has been modified since the last time the file was saved */
  76. MyBoolean                        HasWaveTableWindowBeenModified(WaveTableWindowRec* Window);
  77.  
  78. /* bring the window to the top and give it the focus */
  79. void                                WaveTableWindowBringToTop(WaveTableWindowRec* Window);
  80.  
  81. /* event handling routines */
  82. void                                WaveTableWindowDoIdle(WaveTableWindowRec* Window,
  83.                                             MyBoolean CheckCursorFlag, OrdType XLoc, OrdType YLoc,
  84.                                             ModifierFlags Modifiers);
  85. void                                WaveTableWindowBecomeActive(WaveTableWindowRec* Window);
  86. void                                WaveTableWindowBecomeInactive(WaveTableWindowRec* Window);
  87. void                                WaveTableWindowJustResized(WaveTableWindowRec* Window);
  88. void                                WaveTableWindowDoMouseDown(OrdType XLoc, OrdType YLoc,
  89.                                             ModifierFlags Modifiers, WaveTableWindowRec* Window);
  90. void                                WaveTableWindowDoKeyDown(unsigned char KeyCode,
  91.                                             ModifierFlags Modifiers, WaveTableWindowRec* Window);
  92. void                                WaveTableWindowClose(WaveTableWindowRec* Window);
  93. void                                WaveTableWindowUpdator(WaveTableWindowRec* Window);
  94. void                                WaveTableWindowMenuSetup(WaveTableWindowRec* Window);
  95. void                                WaveTableWindowDoMenuCommand(WaveTableWindowRec* Window,
  96.                                             MenuItemType* MenuItem);
  97.  
  98. /* get a copy of the wave table's name */
  99. char*                                WaveTableWindowGetNameCopy(WaveTableWindowRec* Window);
  100.  
  101. /* get a copy of the wave table's formula */
  102. char*                                WaveTableWindowGetFormulaCopy(WaveTableWindowRec* Window);
  103.  
  104. /* get the number of bits used for the wave table */
  105. NumBitsType                    WaveTableWindowGetNumBits(WaveTableWindowRec* Window);
  106.  
  107. /* get the number of periods in the wave table */
  108. long                                WaveTableWindowGetNumTables(WaveTableWindowRec* Window);
  109.  
  110. /* get the number of frames in each period of the wave table */
  111. long                                WaveTableWindowGetNumFramesPerTable(WaveTableWindowRec* Window);
  112.  
  113. /* get the pitch at which the wave table should be tested */
  114. double                            WaveTableWindowGetPitch(WaveTableWindowRec* Window);
  115.  
  116. /* get the duration (seconds) for the increasing table index phase of the test */
  117. double                            WaveTableWindowGetAscendingDuration(WaveTableWindowRec* Window);
  118.  
  119. /* get the duration (seconds) for the decreasing table index phase of the test */
  120. double                            WaveTableWindowGetDescendingDuration(WaveTableWindowRec* Window);
  121.  
  122. /* get the sampling rate to use for the test */
  123. long                                WaveTableWindowGetTestSamplingRate(WaveTableWindowRec* Window);
  124.  
  125. /* reset the scroll bar indices and redraw it */
  126. void                                WaveTableWindowUpdateScrollBar(WaveTableWindowRec* Window);
  127.  
  128. /* redraw the wave table waveform box */
  129. void                                WaveTableWindowRedrawTable(WaveTableWindowRec* Window);
  130.  
  131. /* the name of the file has changed, so change the title bar.  the string is a */
  132. /* non-null-terminated, and the caller is responsible for disposing of it */
  133. void                                WaveTableWindowGlobalNameChange(WaveTableWindowRec* Window,
  134.                                             char* NewFilename);
  135.  
  136. /* reset the title bar name even if the document name hasn't changed */
  137. void                                WaveTableWindowResetTitlebar(WaveTableWindowRec* Window);
  138.  
  139. /* set the number of periods to that stored in the edit box, and interpolate */
  140. /* the periods. */
  141. void                                WaveTableWindowSetNewNumTables(WaveTableWindowRec* Window);
  142.  
  143. /* set the number of periods edit box to be the same as the data */
  144. void                                WaveTableWindowUpdateTableCountEdit(WaveTableWindowRec* Window);
  145.  
  146. /* set the number of frames edit box to be the same as the data */
  147. void                                WaveTableWindowUpdateFrameCountEdit(WaveTableWindowRec* Window);
  148.  
  149. /* set all edit boxes to be the same as the underlying data */
  150. void                                WaveTableWindowUpdateAllParameters(WaveTableWindowRec* Window);
  151.  
  152. /* give a dialog box asking for a new number of frames, and then interpolate all */
  153. /* of the wave periods. */
  154. void                                WaveTableWindowSetNewNumFrames(WaveTableWindowRec* Window);
  155.  
  156. /* evaluate the wave formula and update the wave data */
  157. void                                WaveTableWindowEvaluateFunction(WaveTableWindowRec* Window);
  158.  
  159. /* get a copy of the wave data array */
  160. largefixedsigned*        WaveTableWindowGetWaveArray(WaveTableWindowRec* Window);
  161.  
  162. /* force the wave data to be written back to the object.  this does not write back */
  163. /* any other data. */
  164. MyBoolean                        WaveTableWindowForceWaveTableUpdate(WaveTableWindowRec* Window);
  165.  
  166. /* force all data to be written back to the object.  this includes calling */
  167. /* WaveTableWindowForceWaveTableUpdate() */
  168. MyBoolean                        WaveTableWindowWritebackModifiedData(WaveTableWindowRec* Window);
  169.  
  170. #endif
  171.